<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./vue.global.js"></script>
</head>
<body>
    <div id="app">
        <my-head>

            <template #title>
                <h2>logo , {{message}}</h2>
            </template>
            <!--2：接受数据-->
            <template #list="{list}">
                <ul>
                    <!--3：遍历-->
                    <li v-for="item in list">{{item}}</li>
                </ul>
            </template>
        </my-head>
    </div>
    <script>
        let app = Vue.createApp({
            data(){
                return {
                    message: 'hello world'
                }
            }
        })

        app.component(
            'MyHead',
            {
                data(){
                    return {
                        count:123,
                        list:['首页','视频','音乐']
                    }
                },
                template: `
                    <header>
                        <slot name="title"></slot>
                        <!--1：slot list分发数据-->
                        <slot name="list" :list="list"></slot>
                    </header>
                `,

            })

        let vm = app.mount('#app');
    </script>

</body>
</html>